package ar.com.photo_admin.service.security

import ar.com.photo_admin.domain.User;

class CaptchaCodeService {

	def simpleCaptchaService
	
	def validateCaptcha(User user) {
		
		boolean captchaValid = simpleCaptchaService.validateCaptcha(user.captchaCode)
		
		if (!captchaValid)
			user.errors.rejectValue("captchaCode", "user.captcha.invalid")
		
		return captchaValid
	}
}
